﻿using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;

namespace JoyfulHomeJourney.BackEnd.Infrastructure.EFCore
{
    public partial class boundless_horizon_car_clubContext : DbContext
    {
        public boundless_horizon_car_clubContext()
        {
        }

        public boundless_horizon_car_clubContext(DbContextOptions<boundless_horizon_car_clubContext> options)
            : base(options)
        {
        }

        public virtual DbSet<ActionLogs> ActionLogs { get; set; }
        public virtual DbSet<ActivityParticipants> ActivityParticipants { get; set; }
        public virtual DbSet<CarEvents> CarEvents { get; set; }
        public virtual DbSet<CustomerOrders> CustomerOrders { get; set; }
        public virtual DbSet<Deductions> Deductions { get; set; }
        public virtual DbSet<Dictionarys> Dictionarys { get; set; }
        public virtual DbSet<Discounts> Discounts { get; set; }
        public virtual DbSet<Employees> Employees { get; set; }
        public virtual DbSet<LoginLogs> LoginLogs { get; set; }
        public virtual DbSet<OfflineOrderDetails> OfflineOrderDetails { get; set; }
        public virtual DbSet<OfflineOrders> OfflineOrders { get; set; }
        public virtual DbSet<OfflineShoppingCars> OfflineShoppingCars { get; set; }
        public virtual DbSet<OnlineCustomerDeductions> OnlineCustomerDeductions { get; set; }
        public virtual DbSet<OnlineCustomerDiscounts> OnlineCustomerDiscounts { get; set; }
        public virtual DbSet<OnlineCustomerInfos> OnlineCustomerInfos { get; set; }
        public virtual DbSet<OrderDetails> OrderDetails { get; set; }
        public virtual DbSet<PointsLogs> PointsLogs { get; set; }
        public virtual DbSet<PointsProducts> PointsProducts { get; set; }
        public virtual DbSet<ProductReviews> ProductReviews { get; set; }
        public virtual DbSet<ReviewLikes> ReviewLikes { get; set; }
        public virtual DbSet<Shifts> Shifts { get; set; }
        public virtual DbSet<ShippingAddresses> ShippingAddresses { get; set; }
        public virtual DbSet<ShippingCompanies> ShippingCompanies { get; set; }
        public virtual DbSet<ShippingInfos> ShippingInfos { get; set; }
        public virtual DbSet<ShoppingCars> ShoppingCars { get; set; }
        public virtual DbSet<SysAccounts> SysAccounts { get; set; }
        public virtual DbSet<SysCarServices> SysCarServices { get; set; }
        public virtual DbSet<SysCarShops> SysCarShops { get; set; }
        public virtual DbSet<SysCarSupplies> SysCarSupplies { get; set; }
        public virtual DbSet<SysCustomers> SysCustomers { get; set; }
        public virtual DbSet<SysDictionaryTypes> SysDictionaryTypes { get; set; }
        public virtual DbSet<SysErrorLogs> SysErrorLogs { get; set; }
        public virtual DbSet<SysProducts> SysProducts { get; set; }
        public virtual DbSet<SysVipPackages> SysVipPackages { get; set; }
        public virtual DbSet<TaskAttachments> TaskAttachments { get; set; }
        public virtual DbSet<TaskCategorieRelationships> TaskCategorieRelationships { get; set; }
        public virtual DbSet<TaskCategories> TaskCategories { get; set; }
        public virtual DbSet<TaskHistorys> TaskHistorys { get; set; }
        public virtual DbSet<TaskReminders> TaskReminders { get; set; }
        public virtual DbSet<TaskSubtasks> TaskSubtasks { get; set; }
        public virtual DbSet<Tasks> Tasks { get; set; }
        public virtual DbSet<TrackingRecords> TrackingRecords { get; set; }
        public virtual DbSet<VipDeductions> VipDeductions { get; set; }
        public virtual DbSet<VipDiscounts> VipDiscounts { get; set; }
        public virtual DbSet<Vips> Vips { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.
                optionsBuilder.UseMySql("server=118.25.142.5;database=boundless_horizon_car_club;user id=root;password=JCmx3s3PBA4fCnQfhEjC@", x => x.ServerVersion("8.0.41-mysql"));
            }
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<ActionLogs>(entity =>
            {
                entity.HasKey(e => e.AlId)
                    .HasName("PRIMARY");

                entity.ToTable("action_logs");

                entity.HasComment("行为日志表");

                entity.HasIndex(e => e.AlAdminId)
                    .HasName("al_admin_id");

                entity.Property(e => e.AlId)
                    .HasColumnName("al_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.AlAdminId)
                    .IsRequired()
                    .HasColumnName("al_admin_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("r-请求人")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.AlAffectedRows)
                    .HasColumnName("al_affected_rows")
                    .HasComment("r-受影响行数");

                entity.Property(e => e.AlCreateTime)
                    .HasColumnName("al_create_time")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("'now()'")
                    .HasComment("r-创建时间");

                entity.Property(e => e.AlIp)
                    .IsRequired()
                    .HasColumnName("al_ip")
                    .HasColumnType("varchar(20)")
                    .HasComment("r-ip地址")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.AlMessage)
                    .IsRequired()
                    .HasColumnName("al_message")
                    .HasColumnType("varchar(200)")
                    .HasComment("r-消息")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.AlRequestMethod)
                    .IsRequired()
                    .HasColumnName("al_request_method")
                    .HasColumnType("varchar(10)")
                    .HasComment("r-请求方法")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.AlRequestParams)
                    .IsRequired()
                    .HasColumnName("al_request_params")
                    .HasColumnType("text")
                    .HasComment("r-请求参数")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.AlRequestUrl)
                    .IsRequired()
                    .HasColumnName("al_request_url")
                    .HasColumnType("varchar(200)")
                    .HasComment("r-请求地址")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.AlAdmin)
                    .WithMany(p => p.ActionLogs)
                    .HasForeignKey(d => d.AlAdminId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("action_logs_ibfk_1");
            });

            modelBuilder.Entity<ActivityParticipants>(entity =>
            {
                entity.HasKey(e => e.ApId)
                    .HasName("PRIMARY");

                entity.ToTable("activity_participants");

                entity.HasIndex(e => e.ApEventId)
                    .HasName("ap_event_id");

                entity.HasIndex(e => e.ApIndustry)
                    .HasName("ap_industry");

                entity.Property(e => e.ApId)
                    .HasColumnName("ap_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,u,d-活动编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ApAge)
                    .HasColumnName("ap_age")
                    .HasComment("r,u,d-年龄");

                entity.Property(e => e.ApCreateAt)
                    .HasColumnName("ap_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-报名时间");

                entity.Property(e => e.ApEmail)
                    .IsRequired()
                    .HasColumnName("ap_email")
                    .HasColumnType("varchar(100)")
                    .HasComment("r,u,d-邮箱地址")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ApEventId)
                    .HasColumnName("ap_event_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r,u-汽车活动ID")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ApGender)
                    .IsRequired()
                    .HasColumnName("ap_gender")
                    .HasColumnType("enum('Male','Female','Other')")
                    .HasComment("r,u,d-性别")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ApIndustry)
                    .HasColumnName("ap_industry")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r,u-行业")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ApName)
                    .HasColumnName("ap_name")
                    .HasColumnType("varchar(50)")
                    .HasComment("r,u,d-姓名")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ApPhone)
                    .HasColumnName("ap_phone")
                    .HasColumnType("varchar(11)")
                    .HasComment("r,u,d-手机号码")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.ApEvent)
                    .WithMany(p => p.ActivityParticipants)
                    .HasForeignKey(d => d.ApEventId)
                    .HasConstraintName("activity_participants_ibfk_2");

                entity.HasOne(d => d.ApIndustryNavigation)
                    .WithMany(p => p.ActivityParticipants)
                    .HasForeignKey(d => d.ApIndustry)
                    .HasConstraintName("activity_participants_ibfk_1");
            });

            modelBuilder.Entity<CarEvents>(entity =>
            {
                entity.HasKey(e => e.CeId)
                    .HasName("PRIMARY");

                entity.ToTable("car_events");

                entity.HasComment("汽车活动表（存储汽车相关活动信息）");

                entity.HasIndex(e => e.CePublisher)
                    .HasName("ce_publisher");

                entity.Property(e => e.CeId)
                    .HasColumnName("ce_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,u,d-活动编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CeCount)
                    .HasColumnName("ce_count")
                    .HasComment("r,u,d-人数");

                entity.Property(e => e.CeCreateAt)
                    .HasColumnName("ce_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.CeDescription)
                    .HasColumnName("ce_description")
                    .HasColumnType("varchar(2000)")
                    .HasComment("c,r,u-活动详细描述")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CeEndTime)
                    .HasColumnName("ce_end_time")
                    .HasColumnType("datetime")
                    .HasComment("c,r,u-活动结束时间（可选）");

                entity.Property(e => e.CeEventType)
                    .HasColumnName("ce_event_type")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r,u-活动类型（比赛、展览、试驾、讲座、社交等）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CeLocation)
                    .IsRequired()
                    .HasColumnName("ce_location")
                    .HasColumnType("varchar(256)")
                    .HasComment("c,r,u-活动地点")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CePublisher)
                    .IsRequired()
                    .HasColumnName("ce_publisher")
                    .HasColumnType("varchar(100)")
                    .HasComment("r-活动发布人（用户id或用户名）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CeStartTime)
                    .HasColumnName("ce_start_time")
                    .HasColumnType("datetime")
                    .HasComment("c,r,u-活动开始时间");

                entity.Property(e => e.CeStatus)
                    .HasColumnName("ce_status")
                    .HasColumnType("enum('planned','ongoing','completed','cancelled')")
                    .HasDefaultValueSql("'planned'")
                    .HasComment("c,r,u-活动状态（计划中、进行中、已完成、已取消）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CeTitle)
                    .IsRequired()
                    .HasColumnName("ce_title")
                    .HasColumnType("varchar(256)")
                    .HasComment("c,r,u-活动标题")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CeUpdateAt)
                    .HasColumnName("ce_update_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-修改时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.HasOne(d => d.CePublisherNavigation)
                    .WithMany(p => p.CarEvents)
                    .HasForeignKey(d => d.CePublisher)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("car_events_ibfk_1");
            });

            modelBuilder.Entity<CustomerOrders>(entity =>
            {
                entity.HasKey(e => e.CoId)
                    .HasName("PRIMARY");

                entity.ToTable("customer_orders");

                entity.HasComment("顾客订单（实际上绑定顾客和账号都可以，这里绑定账号）(折扣卷和抵扣卷作用于订单)");

                entity.HasIndex(e => e.CoAccountId)
                    .HasName("co_account_id");

                entity.HasIndex(e => e.CoCarShopId)
                    .HasName("fk_store_id");

                entity.Property(e => e.CoId)
                    .HasColumnName("co_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb3\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CoAccountId)
                    .IsRequired()
                    .HasColumnName("co_account_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-账号编号（引用账号表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CoCarShopId)
                    .HasColumnName("co_car_shop_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("汽车店编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CoCreateAt)
                    .HasColumnName("co_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.CoPayCount)
                    .HasColumnName("co_pay_count")
                    .HasColumnType("decimal(12,2)")
                    .HasComment("r-实付");

                entity.Property(e => e.CoStatus)
                    .HasColumnName("co_status")
                    .HasColumnType("enum('未支付','已支付','已取消')")
                    .HasComment("r-支付状态")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CoUpdateAt)
                    .HasColumnName("co_update_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-修改时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.Property(e => e.OdDeductionId)
                    .HasColumnName("od_deduction_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-抵扣卷")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OdDiscountId)
                    .HasColumnName("od_discount_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-折扣卷")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.CoAccount)
                    .WithMany(p => p.CustomerOrders)
                    .HasForeignKey(d => d.CoAccountId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("customer_orders_ibfk_1");

                entity.HasOne(d => d.CoCarShop)
                    .WithMany(p => p.CustomerOrders)
                    .HasForeignKey(d => d.CoCarShopId)
                    .OnDelete(DeleteBehavior.SetNull)
                    .HasConstraintName("fk_store_id");
            });

            modelBuilder.Entity<Deductions>(entity =>
            {
                entity.HasKey(e => e.DId)
                    .HasName("PRIMARY");

                entity.ToTable("deductions");

                entity.HasComment("抵扣卷表");

                entity.Property(e => e.DId)
                    .HasColumnName("d_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("c,r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.DCreateTime)
                    .HasColumnName("d_create_time")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("'now()'")
                    .HasComment("r-创建时间");

                entity.Property(e => e.DDeductionCount)
                    .HasColumnName("d_deduction_count")
                    .HasComment("c,r,u-抵扣数");
            });

            modelBuilder.Entity<Dictionarys>(entity =>
            {
                entity.HasKey(e => e.DId)
                    .HasName("PRIMARY");

                entity.ToTable("dictionarys");

                entity.HasComment("字典表");

                entity.HasIndex(e => e.DDictionaryTypeId)
                    .HasName("d_dictionary_type_id");

                entity.HasIndex(e => e.DParentId)
                    .HasName("d_parent_id");

                entity.Property(e => e.DId)
                    .HasColumnName("d_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("c,r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.DCreateTime)
                    .HasColumnName("d_create_time")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("'now()'")
                    .HasComment("r-创建时间");

                entity.Property(e => e.DDictionaryTypeId)
                    .IsRequired()
                    .HasColumnName("d_dictionary_type_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-字典类别")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.DParentId)
                    .HasColumnName("d_parent_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-父级节点")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.DValue)
                    .IsRequired()
                    .HasColumnName("d_value")
                    .HasColumnType("varchar(256)")
                    .HasComment("c,r,u-值")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.DDictionaryType)
                    .WithMany(p => p.Dictionarys)
                    .HasForeignKey(d => d.DDictionaryTypeId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("dictionarys_ibfk_1");

                entity.HasOne(d => d.DParent)
                    .WithMany(p => p.InverseDParent)
                    .HasForeignKey(d => d.DParentId)
                    .HasConstraintName("dictionarys_ibfk_2");
            });

            modelBuilder.Entity<Discounts>(entity =>
            {
                entity.HasKey(e => e.DId)
                    .HasName("PRIMARY");

                entity.ToTable("discounts");

                entity.HasComment("折扣卷表");

                entity.Property(e => e.DId)
                    .HasColumnName("d_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("c,r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.DCreateTime)
                    .HasColumnName("d_create_time")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("'now()'")
                    .HasComment("r-创建时间");

                entity.Property(e => e.DDiscount)
                    .HasColumnName("d_discount")
                    .HasComment("c,r,u-折扣数");

                entity.Property(e => e.DMaxDiscountCount)
                    .HasColumnName("d_max_discount_count")
                    .HasComment("c,r,u-最大抵扣数");
            });

            modelBuilder.Entity<Employees>(entity =>
            {
                entity.HasKey(e => e.EId)
                    .HasName("PRIMARY");

                entity.ToTable("employees");

                entity.HasComment("员工表");

                entity.HasIndex(e => e.EAccountId)
                    .HasName("e_account_id");

                entity.HasIndex(e => e.ECarShopId)
                    .HasName("e_car_shop_id");

                entity.Property(e => e.EId)
                    .HasColumnName("e_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,u,d-（编号）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.EAccountId)
                    .HasColumnName("e_account_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-账号编号（引用账号表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.EAddress)
                    .HasColumnName("e_address")
                    .HasColumnType("varchar(100)")
                    .HasComment("c,r,u-家庭地址")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.EBirthDate)
                    .HasColumnName("e_birth_date")
                    .HasColumnType("date")
                    .HasComment("c,r,u-出生日期");

                entity.Property(e => e.ECarShopId)
                    .IsRequired()
                    .HasColumnName("e_car_shop_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-汽车店编号（引用汽车店表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ECreatedAt)
                    .HasColumnName("e_created_at")
                    .HasColumnType("timestamp")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-数据创建时间");

                entity.Property(e => e.EEmail)
                    .HasColumnName("e_email")
                    .HasColumnType("varchar(50)")
                    .HasComment("c,r,u-电子邮箱")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.EEmergencyContact)
                    .HasColumnName("e_emergency_contact")
                    .HasColumnType("varchar(50)")
                    .HasComment("c,r,u-紧急联系人")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.EGender)
                    .HasColumnName("e_gender")
                    .HasColumnType("varchar(10)")
                    .HasComment("c,r,u-性别")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.EHireDate)
                    .HasColumnName("e_hire_date")
                    .HasColumnType("date")
                    .HasComment("c,r,u-入职日期");

                entity.Property(e => e.EIdCardNumber)
                    .HasColumnName("e_id_card_number")
                    .HasColumnType("varchar(18)")
                    .HasComment("c,r,u-身份证号码")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.EName)
                    .IsRequired()
                    .HasColumnName("e_name")
                    .HasColumnType("varchar(50)")
                    .HasComment("c,r,u-收银员姓名")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.EPhoneNumber)
                    .HasColumnName("e_phone_number")
                    .HasColumnType("varchar(15)")
                    .HasComment("c,r,u-联系电话")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.EPosition)
                    .HasColumnName("e_position")
                    .HasColumnType("varchar(50)")
                    .HasComment("c,r,u-岗位")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ERemark)
                    .HasColumnName("e_remark")
                    .HasColumnType("text")
                    .HasComment("c,r,u-备注")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.EStatus)
                    .HasColumnName("e_status")
                    .HasColumnType("varchar(20)")
                    .HasComment("c,r,u-状态")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.EUpdatedAt)
                    .HasColumnName("e_updated_at")
                    .HasColumnType("timestamp")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-数据最后更新时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.HasOne(d => d.EAccount)
                    .WithMany(p => p.Employees)
                    .HasForeignKey(d => d.EAccountId)
                    .HasConstraintName("employees_ibfk_1");

                entity.HasOne(d => d.ECarShop)
                    .WithMany(p => p.Employees)
                    .HasForeignKey(d => d.ECarShopId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("employees_ibfk_2");
            });

            modelBuilder.Entity<LoginLogs>(entity =>
            {
                entity.HasKey(e => e.LlId)
                    .HasName("PRIMARY");

                entity.ToTable("login_logs");

                entity.HasComment("登录日志表");

                entity.HasIndex(e => e.LlAdminId)
                    .HasName("ll_admin_id");

                entity.Property(e => e.LlId)
                    .HasColumnName("ll_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.LlAdminId)
                    .IsRequired()
                    .HasColumnName("ll_admin_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("r-登录的管理员")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.LlCode)
                    .IsRequired()
                    .HasColumnName("ll_code")
                    .HasColumnType("varchar(32)")
                    .HasComment("r-登录码")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.LlCreateTime)
                    .HasColumnName("ll_create_time")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("'now()'")
                    .HasComment("r-创建时间");

                entity.HasOne(d => d.LlAdmin)
                    .WithMany(p => p.LoginLogs)
                    .HasForeignKey(d => d.LlAdminId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("login_logs_ibfk_1");
            });

            modelBuilder.Entity<OfflineOrderDetails>(entity =>
            {
                entity.HasKey(e => e.OodId)
                    .HasName("PRIMARY");

                entity.ToTable("offline_order_details");

                entity.HasComment("线下订单详情");

                entity.HasIndex(e => e.OodOfflineOrderId)
                    .HasName("ood_offline_order_id");

                entity.HasIndex(e => e.OodProductId)
                    .HasName("ood_product_id");

                entity.Property(e => e.OodId)
                    .HasColumnName("ood_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OodCount)
                    .HasColumnName("ood_count")
                    .HasComment("c,r,u-商品数");

                entity.Property(e => e.OodDeduction)
                    .HasColumnName("ood_deduction")
                    .HasColumnType("decimal(12,2)")
                    .HasComment("c,r-抵扣");

                entity.Property(e => e.OodDiscount)
                    .HasColumnName("ood_discount")
                    .HasComment("c,r-商品折扣（百分比）");

                entity.Property(e => e.OodOfflineOrderId)
                    .IsRequired()
                    .HasColumnName("ood_offline_order_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-线下订单编号（引用线下订单表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OodProductId)
                    .IsRequired()
                    .HasColumnName("ood_product_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-产品编号（引用产品表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OodProductName)
                    .IsRequired()
                    .HasColumnName("ood_product_name")
                    .HasColumnType("varchar(50)")
                    .HasComment("c,r-产品名称")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OodProductPayPrice)
                    .HasColumnName("ood_product_pay_price")
                    .HasColumnType("decimal(12,2)")
                    .HasComment("c,r-商品实付价格(在添加的时候要算上订单的折扣卷和抵扣卷（减去平分后的值）)");

                entity.Property(e => e.OodProductPrice)
                    .HasColumnName("ood_product_price")
                    .HasColumnType("decimal(12,2)")
                    .HasComment("c,r-商品原价");

                entity.Property(e => e.OodSinglePrice)
                    .HasColumnName("ood_single_price")
                    .HasColumnType("decimal(12,2)")
                    .HasComment("c,r-单价");

                entity.Property(e => e.OodVipDiscount)
                    .HasColumnName("ood_vip_discount")
                    .HasDefaultValueSql("'100'")
                    .HasComment("r-会员折扣");

                entity.HasOne(d => d.OodOfflineOrder)
                    .WithMany(p => p.OfflineOrderDetails)
                    .HasForeignKey(d => d.OodOfflineOrderId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("offline_order_details_ibfk_2");

                entity.HasOne(d => d.OodProduct)
                    .WithMany(p => p.OfflineOrderDetails)
                    .HasForeignKey(d => d.OodProductId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("offline_order_details_ibfk_1");
            });

            modelBuilder.Entity<OfflineOrders>(entity =>
            {
                entity.HasKey(e => e.OoId)
                    .HasName("PRIMARY");

                entity.ToTable("offline_orders");

                entity.HasComment("线下订单表（结算时如果用户报了手机号，不记录到线上订单但仍增加积分，积分记录类别记录为线下交易）（如果顾客支付了就不能修改不能删除，支付前都可以修改但不能删除，可以设置状态为已支付）");

                entity.HasIndex(e => e.OdDeductionId)
                    .HasName("od_deduction_id");

                entity.HasIndex(e => e.OdDiscountId)
                    .HasName("od_discount_id");

                entity.HasIndex(e => e.OoAccountId)
                    .HasName("oo_account_id");

                entity.HasIndex(e => e.OoCarShopId)
                    .HasName("oo_car_shop_id");

                entity.Property(e => e.OoId)
                    .HasColumnName("oo_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OdDeductionId)
                    .HasColumnName("od_deduction_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-抵扣卷")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OdDiscountId)
                    .HasColumnName("od_discount_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-折扣卷")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OoAccountId)
                    .HasColumnName("oo_account_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-账号编号（引用账号表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OoCarShopId)
                    .IsRequired()
                    .HasColumnName("oo_car_shop_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-汽车店编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OoCreateAt)
                    .HasColumnName("oo_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.OoPayCount)
                    .HasColumnName("oo_pay_count")
                    .HasColumnType("decimal(12,2)")
                    .HasComment("r-实付");

                entity.Property(e => e.OoStatus)
                    .HasColumnName("oo_status")
                    .HasColumnType("enum('未支付','已支付','已取消')")
                    .HasComment("r-支付状态")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OoUpdateAt)
                    .HasColumnName("oo_update_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-修改时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.HasOne(d => d.OdDeduction)
                    .WithMany(p => p.OfflineOrders)
                    .HasForeignKey(d => d.OdDeductionId)
                    .HasConstraintName("offline_orders_ibfk_3");

                entity.HasOne(d => d.OdDiscount)
                    .WithMany(p => p.OfflineOrders)
                    .HasForeignKey(d => d.OdDiscountId)
                    .HasConstraintName("offline_orders_ibfk_2");

                entity.HasOne(d => d.OoAccount)
                    .WithMany(p => p.OfflineOrders)
                    .HasForeignKey(d => d.OoAccountId)
                    .HasConstraintName("offline_orders_ibfk_1");

                entity.HasOne(d => d.OoCarShop)
                    .WithMany(p => p.OfflineOrders)
                    .HasForeignKey(d => d.OoCarShopId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("offline_orders_ibfk_4");
            });

            modelBuilder.Entity<OfflineShoppingCars>(entity =>
            {
                entity.HasKey(e => e.ScId)
                    .HasName("PRIMARY");

                entity.ToTable("offline_shopping_cars");

                entity.HasComment("购物车（绑定汽车店，点击结算就生成订单）");

                entity.HasIndex(e => e.ScCarShopId)
                    .HasName("sc_car_shop_id");

                entity.HasIndex(e => e.ScProductId)
                    .HasName("sc_product_id");

                entity.Property(e => e.ScId)
                    .HasColumnName("sc_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ScCarShopId)
                    .IsRequired()
                    .HasColumnName("sc_car_shop_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-汽车店编号（引用汽车店表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ScCount)
                    .HasColumnName("sc_count")
                    .HasComment("c,r,u-商品数");

                entity.Property(e => e.ScProductId)
                    .IsRequired()
                    .HasColumnName("sc_product_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-产品编号（引用产品表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.ScCarShop)
                    .WithMany(p => p.OfflineShoppingCars)
                    .HasForeignKey(d => d.ScCarShopId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("offline_shopping_cars_ibfk_1");

                entity.HasOne(d => d.ScProduct)
                    .WithMany(p => p.OfflineShoppingCars)
                    .HasForeignKey(d => d.ScProductId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("offline_shopping_cars_ibfk_2");
            });

            modelBuilder.Entity<OnlineCustomerDeductions>(entity =>
            {
                entity.HasKey(e => e.OcdId)
                    .HasName("PRIMARY");

                entity.ToTable("online_customer_deductions");

                entity.HasComment("客户的折扣卷");

                entity.HasIndex(e => e.OcdDeductionId)
                    .HasName("ocd_deduction_id");

                entity.HasIndex(e => e.OcdOnlineCustomerId)
                    .HasName("ocd_online_customer_id");

                entity.Property(e => e.OcdId)
                    .HasColumnName("ocd_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb3\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("c,r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OcdCreateTime)
                    .HasColumnName("ocd_create_time")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("'now()'")
                    .HasComment("r-创建时间");

                entity.Property(e => e.OcdDeductionId)
                    .IsRequired()
                    .HasColumnName("ocd_deduction_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-抵扣卷")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OcdIsSelected)
                    .HasColumnName("ocd_is_selected")
                    .HasComment("r,u-是否被选中");

                entity.Property(e => e.OcdIsUsed)
                    .HasColumnName("ocd_is_used")
                    .HasComment("r,u-是否使用");

                entity.Property(e => e.OcdOnlineCustomerId)
                    .IsRequired()
                    .HasColumnName("ocd_online_customer_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-客户")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OcdOutTime)
                    .HasColumnName("ocd_out_time")
                    .HasColumnType("datetime")
                    .HasComment("c,r过期时间");

                entity.HasOne(d => d.OcdDeduction)
                    .WithMany(p => p.OnlineCustomerDeductions)
                    .HasForeignKey(d => d.OcdDeductionId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("online_customer_deductions_ibfk_2");

                entity.HasOne(d => d.OcdOnlineCustomer)
                    .WithMany(p => p.OnlineCustomerDeductions)
                    .HasForeignKey(d => d.OcdOnlineCustomerId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("online_customer_deductions_ibfk_1");
            });

            modelBuilder.Entity<OnlineCustomerDiscounts>(entity =>
            {
                entity.HasKey(e => e.OcdId)
                    .HasName("PRIMARY");

                entity.ToTable("online_customer_discounts");

                entity.HasComment("客户的折扣卷");

                entity.HasIndex(e => e.OcdDiscountId)
                    .HasName("ocd_discount_id");

                entity.HasIndex(e => e.OcdOnlineCustomerId)
                    .HasName("ocd_online_customer_id");

                entity.Property(e => e.OcdId)
                    .HasColumnName("ocd_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb3\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("c,r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OcdCreateTime)
                    .HasColumnName("ocd_create_time")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("'now()'")
                    .HasComment("r-创建时间");

                entity.Property(e => e.OcdDiscountId)
                    .IsRequired()
                    .HasColumnName("ocd_discount_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-折扣卷")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OcdIsSelected)
                    .HasColumnName("ocd_is_selected")
                    .HasComment("r,u-是否被选中");

                entity.Property(e => e.OcdIsUsed)
                    .HasColumnName("ocd_is_used")
                    .HasComment("r,u-是否使用");

                entity.Property(e => e.OcdOnlineCustomerId)
                    .IsRequired()
                    .HasColumnName("ocd_online_customer_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-客户")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OcdOutTime)
                    .HasColumnName("ocd_out_time")
                    .HasColumnType("datetime")
                    .HasComment("c,r过期时间");

                entity.HasOne(d => d.OcdDiscount)
                    .WithMany(p => p.OnlineCustomerDiscounts)
                    .HasForeignKey(d => d.OcdDiscountId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("online_customer_discounts_ibfk_2");

                entity.HasOne(d => d.OcdOnlineCustomer)
                    .WithMany(p => p.OnlineCustomerDiscounts)
                    .HasForeignKey(d => d.OcdOnlineCustomerId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("online_customer_discounts_ibfk_1");
            });

            modelBuilder.Entity<OnlineCustomerInfos>(entity =>
            {
                entity.HasKey(e => e.CiId)
                    .HasName("PRIMARY");

                entity.ToTable("online_customer_infos");

                entity.HasComment("消息表");

                entity.HasIndex(e => e.CiReceiveMan)
                    .HasName("ci_receive_man");

                entity.HasIndex(e => e.CiSendMan)
                    .HasName("ci_send_man");

                entity.Property(e => e.CiId)
                    .HasColumnName("ci_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("c,r,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CiContent)
                    .IsRequired()
                    .HasColumnName("ci_content")
                    .HasColumnType("varchar(1000)")
                    .HasComment("c,r-内容")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CiCreateTime)
                    .HasColumnName("ci_create_time")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("'now()'")
                    .HasComment("r-创建时间");

                entity.Property(e => e.CiIsRead)
                    .HasColumnName("ci_is_read")
                    .HasComment("c,r-是否已读");

                entity.Property(e => e.CiReceiveMan)
                    .IsRequired()
                    .HasColumnName("ci_receive_man")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-接受人")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CiSendMan)
                    .IsRequired()
                    .HasColumnName("ci_send_man")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-发送人")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.CiReceiveManNavigation)
                    .WithMany(p => p.OnlineCustomerInfosCiReceiveManNavigation)
                    .HasForeignKey(d => d.CiReceiveMan)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("online_customer_infos_ibfk_2");

                entity.HasOne(d => d.CiSendManNavigation)
                    .WithMany(p => p.OnlineCustomerInfosCiSendManNavigation)
                    .HasForeignKey(d => d.CiSendMan)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("online_customer_infos_ibfk_1");
            });

            modelBuilder.Entity<OrderDetails>(entity =>
            {
                entity.HasKey(e => e.OdId)
                    .HasName("PRIMARY");

                entity.ToTable("order_details");

                entity.HasComment("订单详情（如果顾客支付了就不能修改不能删除，支付前都可以修改但不能删除，可以设置状态为已支付）");

                entity.HasIndex(e => e.OdCutomerOrderId)
                    .HasName("od_cutomer_order_id");

                entity.HasIndex(e => e.OdProductId)
                    .HasName("od_product_id");

                entity.Property(e => e.OdId)
                    .HasColumnName("od_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OdCount)
                    .HasColumnName("od_count")
                    .HasComment("c,r,u-商品数");

                entity.Property(e => e.OdCutomerOrderId)
                    .IsRequired()
                    .HasColumnName("od_cutomer_order_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-订单编号（引用订单表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OdDeduction)
                    .HasColumnName("od_deduction")
                    .HasColumnType("decimal(12,2)")
                    .HasComment("c,r-商品抵扣");

                entity.Property(e => e.OdDiscount)
                    .HasColumnName("od_discount")
                    .HasComment("c,r-商品折扣（百分比）");

                entity.Property(e => e.OdProductId)
                    .IsRequired()
                    .HasColumnName("od_product_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-产品编号（引用产品表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OdProductName)
                    .IsRequired()
                    .HasColumnName("od_product_name")
                    .HasColumnType("varchar(50)")
                    .HasComment("c,r-产品名称")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.OdProductPayPrice)
                    .HasColumnName("od_product_pay_price")
                    .HasColumnType("decimal(12,2)")
                    .HasComment("c,r-商品实付价格(在添加的时候要算上订单的折扣卷和抵扣卷（减去平分后的值）)");

                entity.Property(e => e.OdProductPrice)
                    .HasColumnName("od_product_price")
                    .HasColumnType("decimal(12,2)")
                    .HasComment("c,r-商品原价");

                entity.Property(e => e.OdSinglePrice)
                    .HasColumnName("od_single_price")
                    .HasColumnType("decimal(12,2)")
                    .HasComment("c,r-单价");

                entity.HasOne(d => d.OdCutomerOrder)
                    .WithMany(p => p.OrderDetails)
                    .HasForeignKey(d => d.OdCutomerOrderId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("order_details_ibfk_2");

                entity.HasOne(d => d.OdProduct)
                    .WithMany(p => p.OrderDetails)
                    .HasForeignKey(d => d.OdProductId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("order_details_ibfk_1");
            });

            modelBuilder.Entity<PointsLogs>(entity =>
            {
                entity.HasKey(e => e.PlId)
                    .HasName("PRIMARY");

                entity.ToTable("points_logs");

                entity.HasComment("积分记录表");

                entity.HasIndex(e => e.PlPointProductId)
                    .HasName("pl_point_product_id");

                entity.HasIndex(e => e.PlUser)
                    .HasName("pl_user");

                entity.Property(e => e.PlId)
                    .HasColumnName("pl_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PlCreateAt)
                    .HasColumnName("pl_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.PlLogDescription)
                    .IsRequired()
                    .HasColumnName("pl_log_description")
                    .HasColumnType("varchar(200)")
                    .HasComment("c,r-(说明, 例如\"购买商品\"或\"积分充值\")")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PlPointProductId)
                    .HasColumnName("pl_point_product_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-积分商品编号如果是购买则填")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PlPointsChangeCount)
                    .HasColumnName("pl_points_change_count")
                    .HasComment("c,r-(积分变动值, 正数为增加，负数为减少)");

                entity.Property(e => e.PlUpdateAt)
                    .HasColumnName("pl_update_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-修改时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.Property(e => e.PlUser)
                    .IsRequired()
                    .HasColumnName("pl_user")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-用户（引用账号表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.PlPointProduct)
                    .WithMany(p => p.PointsLogs)
                    .HasForeignKey(d => d.PlPointProductId)
                    .HasConstraintName("points_logs_ibfk_2");

                entity.HasOne(d => d.PlUserNavigation)
                    .WithMany(p => p.PointsLogs)
                    .HasForeignKey(d => d.PlUser)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("points_logs_ibfk_1");
            });

            modelBuilder.Entity<PointsProducts>(entity =>
            {
                entity.HasKey(e => e.PpId)
                    .HasName("PRIMARY");

                entity.ToTable("points_products");

                entity.HasComment("积分商品表");

                entity.HasIndex(e => e.PpProductId)
                    .HasName("pp_product_id");

                entity.Property(e => e.PpId)
                    .HasColumnName("pp_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PpCreateAt)
                    .HasColumnName("pp_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.PpDescription)
                    .HasColumnName("pp_description")
                    .HasColumnType("varchar(1000)")
                    .HasComment("c,r,u-商品描述")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PpName)
                    .IsRequired()
                    .HasColumnName("pp_name")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r,u-商品名称")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PpPointsCost)
                    .HasColumnName("pp_points_cost")
                    .HasComment("c,r,u-所需积分");

                entity.Property(e => e.PpProductId)
                    .IsRequired()
                    .HasColumnName("pp_product_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r,u-商品编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PpStock)
                    .HasColumnName("pp_stock")
                    .HasComment("c,r,u-库存数量");

                entity.Property(e => e.PpUpdateAt)
                    .HasColumnName("pp_update_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-修改时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.HasOne(d => d.PpProduct)
                    .WithMany(p => p.PointsProducts)
                    .HasForeignKey(d => d.PpProductId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("points_products_ibfk_1");
            });

            modelBuilder.Entity<ProductReviews>(entity =>
            {
                entity.HasKey(e => e.PrId)
                    .HasName("PRIMARY");

                entity.ToTable("product_reviews");

                entity.HasComment("产品评价表");

                entity.HasIndex(e => e.PrProductId)
                    .HasName("pr_product_id");

                entity.HasIndex(e => e.PrUser)
                    .HasName("pr_user");

                entity.Property(e => e.PrId)
                    .HasColumnName("pr_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PrCreateAt)
                    .HasColumnName("pr_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.PrIsAnonymous)
                    .HasColumnName("pr_is_anonymous")
                    .HasDefaultValueSql("'0'")
                    .HasComment("c,r-是否匿名");

                entity.Property(e => e.PrParentId)
                    .IsRequired()
                    .HasColumnName("pr_parent_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-父级编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PrProductId)
                    .IsRequired()
                    .HasColumnName("pr_product_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-产品编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PrRating)
                    .HasColumnName("pr_rating")
                    .HasComment("c,r-用户评分");

                entity.Property(e => e.PrReviewText)
                    .HasColumnName("pr_review_text")
                    .HasColumnType("varchar(2000)")
                    .HasComment("c,r-用户评价")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PrUpdateAt)
                    .HasColumnName("pr_update_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-修改时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.Property(e => e.PrUser)
                    .IsRequired()
                    .HasColumnName("pr_user")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-用户编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.PrProduct)
                    .WithMany(p => p.ProductReviews)
                    .HasForeignKey(d => d.PrProductId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("product_reviews_ibfk_1");

                entity.HasOne(d => d.PrUserNavigation)
                    .WithMany(p => p.ProductReviews)
                    .HasForeignKey(d => d.PrUser)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("product_reviews_ibfk_2");
            });

            modelBuilder.Entity<ReviewLikes>(entity =>
            {
                entity.HasKey(e => e.RlId)
                    .HasName("PRIMARY");

                entity.ToTable("review_likes");

                entity.HasComment("产品评价点赞表");

                entity.HasIndex(e => e.RlUser)
                    .HasName("rl_user");

                entity.HasIndex(e => new { e.RlReviewId, e.RlUser })
                    .HasName("rl_review_id")
                    .IsUnique();

                entity.Property(e => e.RlId)
                    .HasColumnName("rl_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.RlCreateAt)
                    .HasColumnName("rl_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.RlReviewId)
                    .IsRequired()
                    .HasColumnName("rl_review_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-评论编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.RlUpdateAt)
                    .HasColumnName("rl_update_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-修改时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.Property(e => e.RlUser)
                    .IsRequired()
                    .HasColumnName("rl_user")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-用户编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.RlReview)
                    .WithMany(p => p.ReviewLikes)
                    .HasForeignKey(d => d.RlReviewId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("review_likes_ibfk_1");

                entity.HasOne(d => d.RlUserNavigation)
                    .WithMany(p => p.ReviewLikes)
                    .HasForeignKey(d => d.RlUser)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("review_likes_ibfk_2");
            });

            modelBuilder.Entity<Shifts>(entity =>
            {
                entity.HasKey(e => e.EShiftId)
                    .HasName("PRIMARY");

                entity.ToTable("shifts");

                entity.HasComment("班次信息表");

                entity.HasIndex(e => e.EEmployeeId)
                    .HasName("e_employee_id");

                entity.Property(e => e.EShiftId)
                    .HasColumnName("e_shift_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ECashRegisterId)
                    .HasColumnName("e_cash_register_id")
                    .HasComment("c,r-收银机编号(随便填)");

                entity.Property(e => e.EEmployeeId)
                    .IsRequired()
                    .HasColumnName("e_employee_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-收银员编号，外键，关联到 employees 表的 e_id")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.EEndTime)
                    .HasColumnName("e_end_time")
                    .HasColumnType("datetime")
                    .HasComment("r,u-班次结束时间（交班时记录）");

                entity.Property(e => e.ENumberOfTransactions)
                    .HasColumnName("e_number_of_transactions")
                    .HasComment("c,r,u-交易笔数");

                entity.Property(e => e.ERemark)
                    .HasColumnName("e_remark")
                    .HasColumnType("text")
                    .HasComment("c,r,u-备注(班次结束后就不能修改)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.EStartTime)
                    .HasColumnName("e_start_time")
                    .HasColumnType("datetime")
                    .HasComment("c,r-班次开始时间(登录时记录)");

                entity.Property(e => e.ETotalAmount)
                    .HasColumnName("e_total_amount")
                    .HasColumnType("decimal(10,2)")
                    .HasComment("c,r,u-收款总额");

                entity.HasOne(d => d.EEmployee)
                    .WithMany(p => p.Shifts)
                    .HasForeignKey(d => d.EEmployeeId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("shifts_ibfk_1");
            });

            modelBuilder.Entity<ShippingAddresses>(entity =>
            {
                entity.HasKey(e => e.SaId)
                    .HasName("PRIMARY");

                entity.ToTable("shipping_addresses");

                entity.HasComment("配送地址表");

                entity.HasIndex(e => e.SaShippingId)
                    .HasName("sa_shipping_id");

                entity.HasIndex(e => e.SaUser)
                    .HasName("sa_user");

                entity.Property(e => e.SaId)
                    .HasColumnName("sa_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,u,d-地址编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.SaCreateAt)
                    .HasColumnName("sa_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.SaDetaiedlAddress)
                    .IsRequired()
                    .HasColumnName("sa_detaiedl_address")
                    .HasColumnType("varchar(256)")
                    .HasComment("c,r,u-详细地址")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.SaPostalCode)
                    .HasColumnName("sa_postal_code")
                    .HasColumnType("char(6)")
                    .HasComment("c,r,u-邮政编码")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.SaRecipientName)
                    .IsRequired()
                    .HasColumnName("sa_recipient_name")
                    .HasColumnType("varchar(50)")
                    .HasComment("c,r,u-收件人姓名")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.SaRecipientPhone)
                    .IsRequired()
                    .HasColumnName("sa_recipient_phone")
                    .HasColumnType("char(11)")
                    .HasComment("c,r,u-收件人电话")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.SaShippingId)
                    .IsRequired()
                    .HasColumnName("sa_shipping_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-物流编号（引用物流表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.SaUpdateAt)
                    .HasColumnName("sa_update_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-修改时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.Property(e => e.SaUser)
                    .IsRequired()
                    .HasColumnName("sa_user")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,d-用户编号（引用用户表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.SaShipping)
                    .WithMany(p => p.ShippingAddresses)
                    .HasForeignKey(d => d.SaShippingId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("shipping_addresses_ibfk_2");

                entity.HasOne(d => d.SaUserNavigation)
                    .WithMany(p => p.ShippingAddresses)
                    .HasForeignKey(d => d.SaUser)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("shipping_addresses_ibfk_1");
            });

            modelBuilder.Entity<ShippingCompanies>(entity =>
            {
                entity.HasKey(e => e.ScId)
                    .HasName("PRIMARY");

                entity.ToTable("shipping_companies");

                entity.HasComment("物流公司表");

                entity.Property(e => e.ScId)
                    .HasColumnName("sc_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,u,d-公司编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ScCreateAt)
                    .HasColumnName("sc_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.ScName)
                    .IsRequired()
                    .HasColumnName("sc_name")
                    .HasColumnType("varchar(256)")
                    .HasComment("c,r,u-公司名称")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ScPhone)
                    .HasColumnName("sc_phone")
                    .HasColumnType("char(11)")
                    .HasComment("c,r,u-联系电话")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ScUpdateAt)
                    .HasColumnName("sc_update_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-修改时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.Property(e => e.ScWebsite)
                    .HasColumnName("sc_website")
                    .HasColumnType("varchar(256)")
                    .HasComment("c,r,u-网址")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");
            });

            modelBuilder.Entity<ShippingInfos>(entity =>
            {
                entity.HasKey(e => e.SiId)
                    .HasName("PRIMARY");

                entity.ToTable("shipping_infos");

                entity.HasComment("物流信息表 (Shipping_Info)");

                entity.HasIndex(e => e.SiCompanyId)
                    .HasName("si_company_id");

                entity.HasIndex(e => e.SiOrderDetailId)
                    .HasName("si_order_detail_id");

                entity.Property(e => e.SiId)
                    .HasColumnName("si_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,u,d-物流编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.SiCompanyId)
                    .IsRequired()
                    .HasColumnName("si_company_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-物流公司编号（引用物流公司）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.SiCreateAt)
                    .HasColumnName("si_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.SiCurrentStatus)
                    .IsRequired()
                    .HasColumnName("si_current_status")
                    .HasColumnType("enum('运输中','已送达','已发货','未发货')")
                    .HasComment("c,r,u当前状态")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.SiEstimatedArrivalDate)
                    .HasColumnName("si_estimated_arrival_date")
                    .HasColumnType("datetime")
                    .HasComment("c,r,u-预计到达时间");

                entity.Property(e => e.SiOrderDetailId)
                    .IsRequired()
                    .HasColumnName("si_order_detail_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-订单详情编号（引用订单详情）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.SiShippingDate)
                    .HasColumnName("si_shipping_date")
                    .HasColumnType("datetime")
                    .HasComment("c,r,u-发货时间");

                entity.Property(e => e.SiTrackingNumber)
                    .HasColumnName("si_tracking_number")
                    .HasComment("c,r-运单号");

                entity.Property(e => e.SiUpdateAt)
                    .HasColumnName("si_update_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-修改时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.HasOne(d => d.SiCompany)
                    .WithMany(p => p.ShippingInfos)
                    .HasForeignKey(d => d.SiCompanyId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("shipping_infos_ibfk_2");

                entity.HasOne(d => d.SiOrderDetail)
                    .WithMany(p => p.ShippingInfos)
                    .HasForeignKey(d => d.SiOrderDetailId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("shipping_infos_ibfk_1");
            });

            modelBuilder.Entity<ShoppingCars>(entity =>
            {
                entity.HasKey(e => e.ScId)
                    .HasName("PRIMARY");

                entity.ToTable("shopping_cars");

                entity.HasComment("购物车（绑定账号）");

                entity.HasIndex(e => e.ScAccountId)
                    .HasName("sc_account_id");

                entity.HasIndex(e => e.ScProductId)
                    .HasName("sc_product_id");

                entity.Property(e => e.ScId)
                    .HasColumnName("sc_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ScAccountId)
                    .IsRequired()
                    .HasColumnName("sc_account_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-账号编号（引用账号表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ScCount)
                    .HasColumnName("sc_count")
                    .HasComment("c,r,u-商品数");

                entity.Property(e => e.ScProductId)
                    .IsRequired()
                    .HasColumnName("sc_product_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-产品编号（引用产品表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.ScAccount)
                    .WithMany(p => p.ShoppingCars)
                    .HasForeignKey(d => d.ScAccountId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("shopping_cars_ibfk_1");

                entity.HasOne(d => d.ScProduct)
                    .WithMany(p => p.ShoppingCars)
                    .HasForeignKey(d => d.ScProductId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("shopping_cars_ibfk_2");
            });

            modelBuilder.Entity<SysAccounts>(entity =>
            {
                entity.HasKey(e => e.AId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_accounts");

                entity.HasComment("账号表");

                entity.HasIndex(e => e.AAccount)
                    .HasName("a_account")
                    .IsUnique();

                entity.Property(e => e.AId)
                    .HasColumnName("a_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.AAccount)
                    .IsRequired()
                    .HasColumnName("a_account")
                    .HasColumnType("varchar(32)")
                    .HasComment("r-账户")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.AAvatar)
                    .HasColumnName("a_avatar")
                    .HasColumnType("varchar(42)")
                    .HasComment("r-头像")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ACreateTime)
                    .HasColumnName("a_create_time")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("'now()'")
                    .HasComment("r-创建时间");

                entity.Property(e => e.AIsBan)
                    .HasColumnName("a_is_ban")
                    .HasComment("是否禁用");

                entity.Property(e => e.AName)
                    .IsRequired()
                    .HasColumnName("a_name")
                    .HasColumnType("varchar(32)")
                    .HasComment("r-名称")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.APassword)
                    .IsRequired()
                    .HasColumnName("a_password")
                    .HasColumnType("varchar(32)")
                    .HasComment("密码")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ARole)
                    .IsRequired()
                    .HasColumnName("a_role")
                    .HasColumnType("enum('admin','carShop','employee','user')")
                    .HasComment("r-角色")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ASalt)
                    .IsRequired()
                    .HasColumnName("a_salt")
                    .HasColumnType("varchar(32)")
                    .HasComment("盐值")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");
            });

            modelBuilder.Entity<SysCarServices>(entity =>
            {
                entity.HasKey(e => e.CsId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_car_services");

                entity.HasComment("汽车服务表(继承商品表，存储汽车相关服务信息)");

                entity.HasIndex(e => e.CsCarShopId)
                    .HasName("cs_car_shop_id");

                entity.HasIndex(e => e.CsProductId)
                    .HasName("cs_product_id");

                entity.HasIndex(e => e.CsServiceType)
                    .HasName("cs_service_type");

                entity.Property(e => e.CsId)
                    .HasColumnName("cs_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,u,d-服务编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsAppointmentRequired)
                    .HasColumnName("cs_appointment_required")
                    .HasDefaultValueSql("'1'")
                    .HasComment("c,r,u-是否需要预约（部分服务可能无需预约）");

                entity.Property(e => e.CsCarShopId)
                    .IsRequired()
                    .HasColumnName("cs_car_shop_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-关联汽车店的编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsCreateAt)
                    .HasColumnName("cs_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.CsDuration)
                    .HasColumnName("cs_duration")
                    .HasComment("c,r,u-服务时长（单位：分钟）");

                entity.Property(e => e.CsProductId)
                    .IsRequired()
                    .HasColumnName("cs_product_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-关联商品表的编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsServiceArea)
                    .HasColumnName("cs_service_area")
                    .HasColumnType("varchar(100)")
                    .HasComment("c,r,u-服务区域（如全市、特定区域等）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsServiceType)
                    .IsRequired()
                    .HasColumnName("cs_service_type")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r,u-服务类型（保养、美容、救援、改装、培训、知识讲座等）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsUpdateAt)
                    .HasColumnName("cs_update_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-修改时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.HasOne(d => d.CsCarShop)
                    .WithMany(p => p.SysCarServices)
                    .HasForeignKey(d => d.CsCarShopId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("sys_car_services_ibfk_2");

                entity.HasOne(d => d.CsProduct)
                    .WithMany(p => p.SysCarServices)
                    .HasForeignKey(d => d.CsProductId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("sys_car_services_ibfk_1");

                entity.HasOne(d => d.CsServiceTypeNavigation)
                    .WithMany(p => p.SysCarServices)
                    .HasForeignKey(d => d.CsServiceType)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("sys_car_services_ibfk_3");
            });

            modelBuilder.Entity<SysCarShops>(entity =>
            {
                entity.HasKey(e => e.CsId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_car_shops");

                entity.HasComment("汽车店表");

                entity.HasIndex(e => e.CsAccount)
                    .HasName("cs_account")
                    .IsUnique();

                entity.HasIndex(e => e.CsType)
                    .HasName("cs_type");

                entity.Property(e => e.CsId)
                    .HasColumnName("cs_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,u,d-店铺唯一标识（编号）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsAccount)
                    .HasColumnName("cs_account")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-账号(引用账号表)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsAddress)
                    .HasColumnName("cs_address")
                    .HasColumnType("varchar(255)")
                    .HasComment("c,r,u-店铺地址")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsCertificateImages)
                    .HasColumnName("cs_certificate_images")
                    .HasColumnType("varchar(420)")
                    .HasComment("c,r,u-门店图片(最多上传十张图片并使用32位uuid作为文件名)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsCity)
                    .HasColumnName("cs_city")
                    .HasColumnType("varchar(50)")
                    .HasComment("c,r,u-市")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsCounty)
                    .HasColumnName("cs_county")
                    .HasColumnType("varchar(100)")
                    .HasComment("c,r,u-县/区/市")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsCreatedAt)
                    .HasColumnName("cs_created_at")
                    .HasColumnType("timestamp")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-数据创建时间");

                entity.Property(e => e.CsEmail)
                    .HasColumnName("cs_email")
                    .HasColumnType("varchar(100)")
                    .HasComment("c,r,u-电子邮箱")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsIsBan)
                    .HasColumnName("cs_is_ban")
                    .HasComment("c,r,u-是否封禁");

                entity.Property(e => e.CsIsOpen)
                    .HasColumnName("cs_is_open")
                    .HasDefaultValueSql("'1'")
                    .HasComment("c,r,u-是否营业");

                entity.Property(e => e.CsIsSelf)
                    .HasColumnName("cs_is_self")
                    .HasComment("c,r,u-是不是自己的店");

                entity.Property(e => e.CsManagerName)
                    .HasColumnName("cs_manager_name")
                    .HasColumnType("varchar(40)")
                    .HasComment("c,r,u-店长姓名")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsName)
                    .IsRequired()
                    .HasColumnName("cs_name")
                    .HasColumnType("varchar(255)")
                    .HasComment("c,r,u-店铺名称")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsNotes)
                    .HasColumnName("cs_notes")
                    .HasColumnType("varchar(500)")
                    .HasComment("c,r,u-备注信息")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsOpeningDate)
                    .HasColumnName("cs_opening_date")
                    .HasColumnType("date")
                    .HasComment("c,r-开业日期");

                entity.Property(e => e.CsOperatingHours)
                    .HasColumnName("cs_operating_hours")
                    .HasColumnType("varchar(11)")
                    .HasComment("c,r,u-营业时间（如09:00-18:00）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsPhone)
                    .HasColumnName("cs_phone")
                    .HasColumnType("varchar(11)")
                    .HasComment("c,r,u-联系电话")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsPostalCode)
                    .HasColumnName("cs_postal_code")
                    .HasColumnType("varchar(6)")
                    .HasComment("c,r,u-邮政编码")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsProvince)
                    .HasColumnName("cs_province")
                    .HasColumnType("varchar(20)")
                    .HasComment("c,r,u-省")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsShopImages)
                    .HasColumnName("cs_shop_images")
                    .HasColumnType("varchar(420)")
                    .HasComment("c,r,u-门店图片(最多上传十张图片并使用32位uuid作为文件名)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsType)
                    .HasColumnName("cs_type")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r,u-店铺类型（如维修店、销售店等）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsUpdatedAt)
                    .HasColumnName("cs_updated_at")
                    .HasColumnType("timestamp")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-数据最后更新时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.Property(e => e.CsWebsite)
                    .HasColumnName("cs_website")
                    .HasColumnType("varchar(255)")
                    .HasComment("c,r,u-官方网站")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.CsAccountNavigation)
                    .WithOne(p => p.SysCarShops)
                    .HasForeignKey<SysCarShops>(d => d.CsAccount)
                    .HasConstraintName("sys_car_shops_ibfk_2");

                entity.HasOne(d => d.CsTypeNavigation)
                    .WithMany(p => p.SysCarShops)
                    .HasForeignKey(d => d.CsType)
                    .HasConstraintName("sys_car_shops_ibfk_1");
            });

            modelBuilder.Entity<SysCarSupplies>(entity =>
            {
                entity.HasKey(e => e.CsId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_car_supplies");

                entity.HasComment("汽车用品表");

                entity.HasIndex(e => e.CsCategory)
                    .HasName("cs_category");

                entity.HasIndex(e => e.CsCreateMan)
                    .HasName("cs_create_man");

                entity.HasIndex(e => e.CsProductId)
                    .HasName("cs_product_id");

                entity.Property(e => e.CsId)
                    .HasColumnName("cs_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("c,r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsCategory)
                    .IsRequired()
                    .HasColumnName("cs_category")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r,u-汽车用品类别(连接字典表)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsColor)
                    .IsRequired()
                    .HasColumnName("cs_color")
                    .HasColumnType("varchar(50)")
                    .HasComment("c,r,u-颜色信息，适用于需要颜色选择的配件（如座套、装饰品等）。手动输入")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsCreateAt)
                    .HasColumnName("cs_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.CsCreateMan)
                    .IsRequired()
                    .HasColumnName("cs_create_man")
                    .HasColumnType("varchar(32)")
                    .HasComment("r-创建人")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsDimension)
                    .IsRequired()
                    .HasColumnName("cs_dimension")
                    .HasColumnType("varchar(200)")
                    .HasComment("c,r,u-配件的尺寸信息，方便客户确认是否适合其车辆。手动输入")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsMarkUp)
                    .HasColumnName("cs_mark_up")
                    .HasColumnType("varchar(500)")
                    .HasComment("c,r,u-备注")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsProductId)
                    .IsRequired()
                    .HasColumnName("cs_product_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-对应的产品编号（连接产品表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CsUpdateAt)
                    .HasColumnName("cs_update_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-修改时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.Property(e => e.CsWeight)
                    .IsRequired()
                    .HasColumnName("cs_weight")
                    .HasColumnType("varchar(50)")
                    .HasComment("c,r,u-记录配件的重量，有助于物流和运输管理。手动输入")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.CsCategoryNavigation)
                    .WithMany(p => p.SysCarSupplies)
                    .HasForeignKey(d => d.CsCategory)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("sys_car_supplies_ibfk_2");

                entity.HasOne(d => d.CsCreateManNavigation)
                    .WithMany(p => p.SysCarSupplies)
                    .HasForeignKey(d => d.CsCreateMan)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("sys_car_supplies_ibfk_3");

                entity.HasOne(d => d.CsProduct)
                    .WithMany(p => p.SysCarSupplies)
                    .HasForeignKey(d => d.CsProductId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("sys_car_supplies_ibfk_1");
            });

            modelBuilder.Entity<SysCustomers>(entity =>
            {
                entity.HasKey(e => e.CUserId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_customers");

                entity.HasComment("顾客表");

                entity.HasIndex(e => e.CAccount)
                    .HasName("c_account")
                    .IsUnique();

                entity.Property(e => e.CUserId)
                    .HasColumnName("c_user_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,u,d-（编号）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CAccount)
                    .IsRequired()
                    .HasColumnName("c_account")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-账号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CAddress)
                    .HasColumnName("c_address")
                    .HasColumnType("varchar(255)")
                    .HasComment("c,r,u-地址")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CAvatar)
                    .HasColumnName("c_avatar")
                    .HasColumnType("varchar(255)")
                    .HasComment("c,r,u-头像路径或 URL")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CBirthday)
                    .HasColumnName("c_birthday")
                    .HasColumnType("date")
                    .HasComment("c,r,u-生日");

                entity.Property(e => e.CCreatedAt)
                    .HasColumnName("c_created_at")
                    .HasColumnType("timestamp")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-数据创建时间");

                entity.Property(e => e.CEmail)
                    .HasColumnName("c_email")
                    .HasColumnType("varchar(100)")
                    .HasComment("c,r,u-邮箱地址")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CGender)
                    .HasColumnName("c_gender")
                    .HasColumnType("enum('male','female')")
                    .HasComment("c,r,u-性别")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CIpAddress)
                    .HasColumnName("c_ip_address")
                    .HasColumnType("varchar(45)")
                    .HasComment("c,r,u-IP 地址")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CLastLoginTime)
                    .HasColumnName("c_last_login_time")
                    .HasColumnType("datetime")
                    .HasComment("c,r,u-最后登录时间");

                entity.Property(e => e.CPhoneNumber)
                    .HasColumnName("c_phone_number")
                    .HasColumnType("varchar(20)")
                    .HasComment("c,r,u-手机号码")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CPoints)
                    .HasColumnName("c_points")
                    .HasDefaultValueSql("'0'")
                    .HasComment("c,r,u-积分");

                entity.Property(e => e.CStatus)
                    .HasColumnName("c_status")
                    .HasColumnType("enum('active','disabled','pending')")
                    .HasDefaultValueSql("'pending'")
                    .HasComment("c,r,u-用户状态")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CUpdatedAt)
                    .HasColumnName("c_updated_at")
                    .HasColumnType("timestamp")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-数据最后更新时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.Property(e => e.CVip)
                    .HasColumnName("c_vip")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r,u-会员（引用会员表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.CAccountNavigation)
                    .WithOne(p => p.SysCustomers)
                    .HasForeignKey<SysCustomers>(d => d.CAccount)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("sys_customers_ibfk_1");
            });

            modelBuilder.Entity<SysDictionaryTypes>(entity =>
            {
                entity.HasKey(e => e.DtId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_dictionary_types");

                entity.HasComment("字典类别表");

                entity.HasIndex(e => e.DtAuth)
                    .HasName("dt_auth");

                entity.HasIndex(e => e.DtKey)
                    .HasName("dt_key")
                    .IsUnique();

                entity.Property(e => e.DtId)
                    .HasColumnName("dt_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("c,r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.DtAuth)
                    .IsRequired()
                    .HasColumnName("dt_auth")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-作者(引用账号表)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.DtCreateTime)
                    .HasColumnName("dt_create_time")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("'now()'")
                    .HasComment("r-创建时间");

                entity.Property(e => e.DtDescription)
                    .HasColumnName("dt_description")
                    .HasColumnType("varchar(400)")
                    .HasComment("c,r,u-描述")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.DtKey)
                    .IsRequired()
                    .HasColumnName("dt_key")
                    .HasColumnType("varchar(256)")
                    .HasComment("c,r,u-查询键值")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.DtName)
                    .IsRequired()
                    .HasColumnName("dt_name")
                    .HasColumnType("varchar(256)")
                    .HasComment("c,r,u-名称")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.DtAuthNavigation)
                    .WithMany(p => p.SysDictionaryTypes)
                    .HasForeignKey(d => d.DtAuth)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("sys_dictionary_types_ibfk_1");
            });

            modelBuilder.Entity<SysErrorLogs>(entity =>
            {
                entity.HasKey(e => e.ElId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_error_logs");

                entity.HasComment("错误日志主表");

                entity.Property(e => e.ElId)
                    .HasColumnName("el_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ElCreateTime)
                    .HasColumnName("el_create_time")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("'now()'")
                    .HasComment("r-创建时间");

                entity.Property(e => e.ElErrorTime)
                    .HasColumnName("el_error_time")
                    .HasColumnType("datetime")
                    .HasComment("r-报错时间");

                entity.Property(e => e.ElMessage)
                    .IsRequired()
                    .HasColumnName("el_message")
                    .HasColumnType("varchar(200)")
                    .HasComment("r-错误消息")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ElParams)
                    .HasColumnName("el_params")
                    .HasColumnType("text")
                    .HasComment("r-参数")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ElStackTrack)
                    .IsRequired()
                    .HasColumnName("el_stack_track")
                    .HasColumnType("text")
                    .HasComment("r-堆栈跟踪")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ElUrl)
                    .IsRequired()
                    .HasColumnName("el_url")
                    .HasColumnType("varchar(200)")
                    .HasComment("r-请求地址")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");
            });

            modelBuilder.Entity<SysProducts>(entity =>
            {
                entity.HasKey(e => e.PId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_products");

                entity.HasComment("商品表(所有商品都引用该表，使它们享有相同的字段)");

                entity.HasIndex(e => e.PBrand)
                    .HasName("p_brand");

                entity.HasIndex(e => e.PCsId)
                    .HasName("p_cs_id");

                entity.Property(e => e.PId)
                    .HasColumnName("p_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("c,r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PBrand)
                    .HasColumnName("p_brand")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r,u-记录品牌名称，有助于消费者识别和选择。（连接到字典表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PCategory)
                    .IsRequired()
                    .HasColumnName("p_category")
                    .HasColumnType("enum('sys_car_supplies','car_services','sys_vip_packages')")
                    .HasComment("商品类别(用于判断商品应该链接哪张表)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PCreateAt)
                    .HasColumnName("p_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.PCsId)
                    .IsRequired()
                    .HasColumnName("p_cs_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r,u-汽车店编号（引用汽车表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PDeduction)
                    .HasColumnName("p_deduction")
                    .HasColumnType("decimal(12,2)")
                    .HasComment("c,r,u-抵扣(购买商品时减少的金额)");

                entity.Property(e => e.PDescription)
                    .HasColumnName("p_description")
                    .HasColumnType("varchar(2000)")
                    .HasComment("c,r,u-描述(最多1000个汉字或2000个字母或符号)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PDiscount)
                    .HasColumnName("p_discount")
                    .HasDefaultValueSql("'100'")
                    .HasComment("c,r,u-折扣(百分比如20表示计算时乘以20%)");

                entity.Property(e => e.PImages)
                    .HasColumnName("p_images")
                    .HasColumnType("varchar(420)")
                    .HasComment("c,r,u-图片组(最多上传十张图片并使用32位uuid作为文件名)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PName)
                    .IsRequired()
                    .HasColumnName("p_name")
                    .HasColumnType("varchar(256)")
                    .HasComment("c,r,u-名称")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.PPrice)
                    .HasColumnName("p_price")
                    .HasColumnType("decimal(12,2)")
                    .HasComment("c,r,u-价格(保留两位小数)");

                entity.Property(e => e.PRating)
                    .HasColumnName("p_rating")
                    .HasColumnType("decimal(2,1)")
                    .HasDefaultValueSql("'0'")
                    .HasComment("r-评分（等于0说明没有评分）");

                entity.Property(e => e.PSaleCount)
                    .HasColumnName("p_sale_count")
                    .HasComment("r-售出数(从创建日期到目前的出售数)");

                entity.Property(e => e.PSaleSum)
                    .HasColumnName("p_sale_sum")
                    .HasColumnType("decimal(20,2)")
                    .HasComment("r-出售总金额");

                entity.Property(e => e.PStockQuantity)
                    .HasColumnName("p_stock_quantity")
                    .HasComment("c,r,u-库存(可以在添加的时候就给值)");

                entity.Property(e => e.PUpdateAt)
                    .HasColumnName("p_update_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-修改时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.HasOne(d => d.PBrandNavigation)
                    .WithMany(p => p.SysProducts)
                    .HasForeignKey(d => d.PBrand)
                    .HasConstraintName("sys_products_ibfk_1");

                entity.HasOne(d => d.PCs)
                    .WithMany(p => p.SysProducts)
                    .HasForeignKey(d => d.PCsId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("sys_products_ibfk_2");
            });

            modelBuilder.Entity<SysVipPackages>(entity =>
            {
                entity.HasKey(e => e.VpId)
                    .HasName("PRIMARY");

                entity.ToTable("sys_vip_packages");

                entity.HasComment("会员套餐");

                entity.HasIndex(e => e.VpProductId)
                    .HasName("vp_product_id");

                entity.HasIndex(e => e.VpVipId)
                    .HasName("vp_vip_id");

                entity.Property(e => e.VpId)
                    .HasColumnName("vp_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("c,r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.VpCreateAt)
                    .HasColumnName("vp_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.VpMonth)
                    .HasColumnName("vp_month")
                    .HasComment("c,r,u-月数");

                entity.Property(e => e.VpProductId)
                    .IsRequired()
                    .HasColumnName("vp_product_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-产品编号(引用了产品表)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.VpUpdateAt)
                    .HasColumnName("vp_update_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-修改时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.Property(e => e.VpVipId)
                    .IsRequired()
                    .HasColumnName("vp_vip_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-会员(引用了VIP表)")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.VpYear)
                    .HasColumnName("vp_year")
                    .HasComment("c,r,u-年数");

                entity.HasOne(d => d.VpProduct)
                    .WithMany(p => p.SysVipPackages)
                    .HasForeignKey(d => d.VpProductId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("sys_vip_packages_ibfk_1");

                entity.HasOne(d => d.VpVip)
                    .WithMany(p => p.SysVipPackages)
                    .HasForeignKey(d => d.VpVipId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("sys_vip_packages_ibfk_2");
            });

            modelBuilder.Entity<TaskAttachments>(entity =>
            {
                entity.HasKey(e => e.TaAttachmentId)
                    .HasName("PRIMARY");

                entity.ToTable("task_attachments");

                entity.HasComment("任务附件表");

                entity.HasIndex(e => e.TaTaskId)
                    .HasName("ta_task_id");

                entity.Property(e => e.TaAttachmentId)
                    .HasColumnName("ta_attachment_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TaFilePath)
                    .IsRequired()
                    .HasColumnName("ta_file_path")
                    .HasColumnType("varchar(255)")
                    .HasComment("c,r,u-文件存储路径")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TaTaskId)
                    .IsRequired()
                    .HasColumnName("ta_task_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-关联任务id")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TaUploadedAt)
                    .HasColumnName("ta_uploaded_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-上传时间");

                entity.HasOne(d => d.TaTask)
                    .WithMany(p => p.TaskAttachments)
                    .HasForeignKey(d => d.TaTaskId)
                    .HasConstraintName("task_attachments_ibfk_1");
            });

            modelBuilder.Entity<TaskCategorieRelationships>(entity =>
            {
                entity.HasKey(e => e.TcrId)
                    .HasName("PRIMARY");

                entity.ToTable("task_categorie_relationships");

                entity.HasComment("任务-分类关系表");

                entity.HasIndex(e => e.TcrCategoryId)
                    .HasName("tcr_category_id");

                entity.HasIndex(e => new { e.TcrTaskId, e.TcrCategoryId })
                    .HasName("tcr_task_id")
                    .IsUnique();

                entity.Property(e => e.TcrId)
                    .HasColumnName("tcr_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TcrCategoryId)
                    .IsRequired()
                    .HasColumnName("tcr_category_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-关联分类id")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TcrTaskId)
                    .IsRequired()
                    .HasColumnName("tcr_task_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-关联任务id")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.TcrCategory)
                    .WithMany(p => p.TaskCategorieRelationships)
                    .HasForeignKey(d => d.TcrCategoryId)
                    .HasConstraintName("task_categorie_relationships_ibfk_2");

                entity.HasOne(d => d.TcrTask)
                    .WithMany(p => p.TaskCategorieRelationships)
                    .HasForeignKey(d => d.TcrTaskId)
                    .HasConstraintName("task_categorie_relationships_ibfk_1");
            });

            modelBuilder.Entity<TaskCategories>(entity =>
            {
                entity.HasKey(e => e.TcCategoryId)
                    .HasName("PRIMARY");

                entity.ToTable("task_categories");

                entity.HasComment("任务分类表");

                entity.HasIndex(e => new { e.TcAccountId, e.TcName })
                    .HasName("idx_c_user_category")
                    .IsUnique();

                entity.Property(e => e.TcCategoryId)
                    .HasColumnName("tc_category_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TcAccountId)
                    .IsRequired()
                    .HasColumnName("tc_account_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-所属账号id")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TcColor)
                    .HasColumnName("tc_color")
                    .HasColumnType("varchar(20)")
                    .HasComment("c,r,u-颜色标记（如#HEX）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TcName)
                    .IsRequired()
                    .HasColumnName("tc_name")
                    .HasColumnType("varchar(50)")
                    .HasComment("c,r,u-分类名称")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.TcAccount)
                    .WithMany(p => p.TaskCategories)
                    .HasForeignKey(d => d.TcAccountId)
                    .HasConstraintName("task_categories_ibfk_1");
            });

            modelBuilder.Entity<TaskHistorys>(entity =>
            {
                entity.HasKey(e => e.ThHistoryId)
                    .HasName("PRIMARY");

                entity.ToTable("task_historys");

                entity.HasComment("任务操作历史表");

                entity.HasIndex(e => e.ThAccountId)
                    .HasName("th_account_id");

                entity.HasIndex(e => e.ThTaskId)
                    .HasName("th_task_id");

                entity.Property(e => e.ThHistoryId)
                    .HasColumnName("th_history_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ThAccountId)
                    .IsRequired()
                    .HasColumnName("th_account_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r操作用户id")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ThAction)
                    .HasColumnName("th_action")
                    .HasColumnType("enum('create','update','delete')")
                    .HasComment("c,r-操作类型")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ThChangedAt)
                    .HasColumnName("th_changed_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("c,r-变更时间");

                entity.Property(e => e.ThOldValue)
                    .HasColumnName("th_old_value")
                    .HasColumnType("text")
                    .HasComment("c,r-修改前的值（JSON格式）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.ThTaskId)
                    .IsRequired()
                    .HasColumnName("th_task_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-关联任务id")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.ThAccount)
                    .WithMany(p => p.TaskHistorys)
                    .HasForeignKey(d => d.ThAccountId)
                    .HasConstraintName("task_historys_ibfk_2");

                entity.HasOne(d => d.ThTask)
                    .WithMany(p => p.TaskHistorys)
                    .HasForeignKey(d => d.ThTaskId)
                    .HasConstraintName("task_historys_ibfk_1");
            });

            modelBuilder.Entity<TaskReminders>(entity =>
            {
                entity.HasKey(e => e.TrReminderId)
                    .HasName("PRIMARY");

                entity.ToTable("task_reminders");

                entity.HasComment("任务提醒表");

                entity.HasIndex(e => e.TrRemindTime)
                    .HasName("idx_r_remind_time");

                entity.HasIndex(e => e.TrTaskId)
                    .HasName("tr_task_id");

                entity.Property(e => e.TrReminderId)
                    .HasColumnName("tr_reminder_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TrIsTriggered)
                    .HasColumnName("tr_is_triggered")
                    .HasDefaultValueSql("'0'")
                    .HasComment("r,u-是否已触发");

                entity.Property(e => e.TrRemindTime)
                    .HasColumnName("tr_remind_time")
                    .HasColumnType("datetime")
                    .HasComment("c,r,u-提醒触发时间");

                entity.Property(e => e.TrTaskId)
                    .IsRequired()
                    .HasColumnName("tr_task_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-关联任务id")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.TrTask)
                    .WithMany(p => p.TaskReminders)
                    .HasForeignKey(d => d.TrTaskId)
                    .HasConstraintName("task_reminders_ibfk_1");
            });

            modelBuilder.Entity<TaskSubtasks>(entity =>
            {
                entity.HasKey(e => e.TsSubtaskId)
                    .HasName("PRIMARY");

                entity.ToTable("task_subtasks");

                entity.HasComment("子任务表");

                entity.HasIndex(e => e.TsTaskId)
                    .HasName("ts_task_id");

                entity.Property(e => e.TsSubtaskId)
                    .HasColumnName("ts_subtask_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TsCreatedAt)
                    .HasColumnName("ts_created_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.TsStatus)
                    .HasColumnName("ts_status")
                    .HasColumnType("enum('pending','completed')")
                    .HasDefaultValueSql("'pending'")
                    .HasComment("r,u-子任务状态")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TsTaskId)
                    .IsRequired()
                    .HasColumnName("ts_task_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-父任务id")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TsTitle)
                    .IsRequired()
                    .HasColumnName("ts_title")
                    .HasColumnType("varchar(100)")
                    .HasComment("c,r,u-子任务标题")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.TsTask)
                    .WithMany(p => p.TaskSubtasks)
                    .HasForeignKey(d => d.TsTaskId)
                    .HasConstraintName("task_subtasks_ibfk_1");
            });

            modelBuilder.Entity<Tasks>(entity =>
            {
                entity.HasKey(e => e.TId)
                    .HasName("PRIMARY");

                entity.ToTable("tasks");

                entity.HasComment("任务主表");

                entity.HasIndex(e => new { e.TAccountId, e.TStatus })
                    .HasName("idx_t_user_status");

                entity.Property(e => e.TId)
                    .HasColumnName("t_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb3\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.IsDeleted)
                    .HasColumnName("is_deleted")
                    .HasDefaultValueSql("'0'")
                    .HasComment("u-0:正常，1:删除");

                entity.Property(e => e.TAccountId)
                    .IsRequired()
                    .HasColumnName("t_account_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-所属账号id")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TCreatedAt)
                    .HasColumnName("t_created_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.TDescription)
                    .HasColumnName("t_description")
                    .HasColumnType("text")
                    .HasComment("c,r,u-任务详细描述")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TDueDate)
                    .HasColumnName("t_due_date")
                    .HasColumnType("datetime")
                    .HasComment("c,r,u-截止时间");

                entity.Property(e => e.TPriority)
                    .HasColumnName("t_priority")
                    .HasColumnType("enum('low','medium','high')")
                    .HasDefaultValueSql("'medium'")
                    .HasComment("c,r,u-优先级")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TStatus)
                    .HasColumnName("t_status")
                    .HasColumnType("enum('pending','processing','completed')")
                    .HasDefaultValueSql("'pending'")
                    .HasComment("r,u-任务状态")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TTitle)
                    .IsRequired()
                    .HasColumnName("t_title")
                    .HasColumnType("varchar(100)")
                    .HasComment("c,r,u-任务标题")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TUpdatedAt)
                    .HasColumnName("t_updated_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-最后更新时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.HasOne(d => d.TAccount)
                    .WithMany(p => p.Tasks)
                    .HasForeignKey(d => d.TAccountId)
                    .HasConstraintName("tasks_ibfk_1");
            });

            modelBuilder.Entity<TrackingRecords>(entity =>
            {
                entity.HasKey(e => e.TrId)
                    .HasName("PRIMARY");

                entity.ToTable("tracking_records");

                entity.HasComment("物流跟踪记录表");

                entity.HasIndex(e => e.TrShippingId)
                    .HasName("tr_shipping_id");

                entity.Property(e => e.TrId)
                    .HasColumnName("tr_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("r-跟踪编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.CeCreateAt)
                    .HasColumnName("ce_create_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-创建时间");

                entity.Property(e => e.CeUpdateAt)
                    .HasColumnName("ce_update_at")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("r-修改时间")
                    .ValueGeneratedOnAddOrUpdate();

                entity.Property(e => e.TrLocation)
                    .IsRequired()
                    .HasColumnName("tr_location")
                    .HasColumnType("varchar(256)")
                    .HasComment("c,r-位置")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TrShippingId)
                    .IsRequired()
                    .HasColumnName("tr_shipping_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-物流编号（引用物流表）")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TrStatusDescription)
                    .IsRequired()
                    .HasColumnName("tr_status_description")
                    .HasColumnType("varchar(100)")
                    .HasComment("c,r-状态描述")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.TrUpdateTime)
                    .HasColumnName("tr_update_time")
                    .HasColumnType("datetime")
                    .HasComment("c,r-更新时间");

                entity.HasOne(d => d.TrShipping)
                    .WithMany(p => p.TrackingRecords)
                    .HasForeignKey(d => d.TrShippingId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("tracking_records_ibfk_1");
            });

            modelBuilder.Entity<VipDeductions>(entity =>
            {
                entity.HasKey(e => e.VdId)
                    .HasName("PRIMARY");

                entity.ToTable("vip_deductions");

                entity.HasComment("可获得的抵扣卷表");

                entity.HasIndex(e => e.VdDeductionId)
                    .HasName("vd_deduction_id");

                entity.HasIndex(e => e.VdVipId)
                    .HasName("vd_vip_id");

                entity.Property(e => e.VdId)
                    .HasColumnName("vd_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("c,r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.VdCount)
                    .HasColumnName("vd_count")
                    .HasComment("c,r,u-数量");

                entity.Property(e => e.VdCreateTime)
                    .HasColumnName("vd_create_time")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("'now()'")
                    .HasComment("r-创建时间");

                entity.Property(e => e.VdDeductionId)
                    .IsRequired()
                    .HasColumnName("vd_deduction_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-抵扣编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.VdEffectiveDay)
                    .HasColumnName("vd_effective_day")
                    .HasDefaultValueSql("'30'")
                    .HasComment("c,r,u-有效天数");

                entity.Property(e => e.VdVipId)
                    .IsRequired()
                    .HasColumnName("vd_vip_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-vip编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.VdDeduction)
                    .WithMany(p => p.VipDeductions)
                    .HasForeignKey(d => d.VdDeductionId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("vip_deductions_ibfk_2");

                entity.HasOne(d => d.VdVip)
                    .WithMany(p => p.VipDeductions)
                    .HasForeignKey(d => d.VdVipId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("vip_deductions_ibfk_1");
            });

            modelBuilder.Entity<VipDiscounts>(entity =>
            {
                entity.HasKey(e => e.VdId)
                    .HasName("PRIMARY");

                entity.ToTable("vip_discounts");

                entity.HasComment("可获得的折扣卷表");

                entity.HasIndex(e => e.VdDiscountId)
                    .HasName("vd_discount_id");

                entity.HasIndex(e => e.VdVipId)
                    .HasName("vd_vip_id");

                entity.Property(e => e.VdId)
                    .HasColumnName("vd_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("c,r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.VdCount)
                    .HasColumnName("vd_count")
                    .HasComment("c,r,u-数量");

                entity.Property(e => e.VdCreateTime)
                    .HasColumnName("vd_create_time")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("'now()'")
                    .HasComment("r-创建时间");

                entity.Property(e => e.VdDiscountId)
                    .IsRequired()
                    .HasColumnName("vd_discount_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-折扣卷编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.VdEffectiveDay)
                    .HasColumnName("vd_effective_day")
                    .HasDefaultValueSql("'30'")
                    .HasComment("c,r,u-有效天数");

                entity.Property(e => e.VdVipId)
                    .IsRequired()
                    .HasColumnName("vd_vip_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r-vip编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.VdDiscount)
                    .WithMany(p => p.VipDiscounts)
                    .HasForeignKey(d => d.VdDiscountId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("vip_discounts_ibfk_2");

                entity.HasOne(d => d.VdVip)
                    .WithMany(p => p.VipDiscounts)
                    .HasForeignKey(d => d.VdVipId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("vip_discounts_ibfk_1");
            });

            modelBuilder.Entity<Vips>(entity =>
            {
                entity.HasKey(e => e.VId)
                    .HasName("PRIMARY");

                entity.ToTable("vips");

                entity.HasComment("vip表");

                entity.HasIndex(e => e.VCsId)
                    .HasName("v_cs_id");

                entity.Property(e => e.VId)
                    .HasColumnName("v_id")
                    .HasColumnType("varchar(32)")
                    .HasDefaultValueSql("'replace(uuid(),_utf8mb4\\\\''-\\\\'',_utf8mb4\\\\''\\\\'')'")
                    .HasComment("c,r,u,d-编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.VCreateTime)
                    .HasColumnName("v_create_time")
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("'now()'")
                    .HasComment("r-创建时间");

                entity.Property(e => e.VCsId)
                    .IsRequired()
                    .HasColumnName("v_cs_id")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r,u-汽车店编号")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.VDescription)
                    .IsRequired()
                    .HasColumnName("v_description")
                    .HasColumnType("varchar(400)")
                    .HasComment("c,r,u-描述")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.VFoeverDiscount)
                    .HasColumnName("v_foever_discount")
                    .HasDefaultValueSql("'1'")
                    .HasComment("c,r,u-永久折扣(与折扣卷取最小值)");

                entity.Property(e => e.VLevel)
                    .HasColumnName("v_level")
                    .HasComment("c,r,u-等级");

                entity.Property(e => e.VName)
                    .IsRequired()
                    .HasColumnName("v_name")
                    .HasColumnType("varchar(32)")
                    .HasComment("c,r,u-名称")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.VpColor)
                    .IsRequired()
                    .HasColumnName("vp_color")
                    .HasColumnType("varchar(20)")
                    .HasComment("c,r,u-颜色")
                    .HasCharSet("utf8mb4")
                    .HasCollation("utf8mb4_unicode_ci");

                entity.HasOne(d => d.VCs)
                    .WithMany(p => p.Vips)
                    .HasForeignKey(d => d.VCsId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("vips_ibfk_1");
            });

            OnModelCreatingPartial(modelBuilder);
        }

        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}
